package com.iweb.newa202104.exception;

import com.iweb.newa202104.enums.Err;
import lombok.Getter;

/**
 * @Author: LGZ
 * @Date: 2021/1/27 16:56
 * @Description: 异常处理
 */
@Getter
public class CommonException extends RuntimeException {
    private Integer code;

    public CommonException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public CommonException(Err err) {
        super(err.getMsg());
        this.code = err.getCode();
    }
}
